<template>
  <div>
    <h1>home</h1>
    <div>
      <button @click="$router.back()">回退</button>
      <button @click="$router.forward()">前进</button>
      <button @click="$router.go(-2)">回退2</button>
    </div>
    <hr />
    <div>
      <button @click="toNews">新闻</button>
      <button @click="toMusic">音乐</button>
      <button @click="toEntertainment">娱乐</button>
    </div>
    <hr />
    <router-view></router-view>
  </div>
</template>

<script>
  export default {
    name: "Home",
    methods: {
      toNews() {
        this.$router.push("/home/news");
      },
      toMusic() {
        this.$router.replace({
          path: "music",
        });
      },
      toEntertainment() {
        this.$router.push({
          name: "entertainment",
        });
      },
    },
  };
</script>

<style></style>
